package huhx.linux.com.kotlinlearn.common

import com.google.gson.Gson
import huhx.linux.com.kotlinlearn.constants.TransConstants
import java.io.Serializable

/**
 * Created by huhx on 2018-03-17 下午 2:49.
 */

data class ResponseBean<T>(var returnCode: Int, var returnMsg: String, var response: T) : Serializable {

    fun isSuccess(): Boolean {
        return returnCode == TransConstants.TRAN_SUCCESS
    }

    override fun toString(): String {
        return Gson().toJson(this)
    }
}